package com.lv.controller;

import com.lv.data.Result;
import com.lv.pojo.TbSeller;
import com.lv.service.SellerService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("seller")
public class SellerController {
    @DubboReference
    private SellerService ss;

    @RequestMapping("toselleer")
    public String toselleer() {
        return "admin/seller_1";
    }

    @RequestMapping("getInfo")
    @ResponseBody
    public Result getInfo(){
        try {
            List<TbSeller> list =ss.getInfo();
            return Result.OK().setData(list);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.ER();
        }
    }

    @RequestMapping("up")
    @ResponseBody
    public Result up(String[] ids,String status){

        Integer i = ss.up(ids,status);

        return Result.OK();
    }
}
